<template>
	<view class="">
		<view class="u-flex-col u-col-center u-row-center u-flex-1" style="margin: 40rpx 0;">
			<view style="display: flex;justify-content: center;flex-direction: column;align-items: center;">
				<slot>
					<image src="https://app.zbzedu.com/static/WaChat/img/noData.png" style="width: 292rpx;height: 292rpx;" v-show="showDataImg">
					</image>
					<view class="u-font-36 btn font-b" @click="jump" :class="{'disabled': disabled}">
						{{btnString || '暂无目标职业，快去更新吧！'}}
					</view>
				</slot>
			</view>
		</view>
		<view class="" v-if="lineShow">
			<u-gap height="5" bg-color="#EEEEEE" v-show="showLine"></u-gap>
			<u-gap height="20" bg-color="#EEEEEE" v-show="showBline"></u-gap>
		</view>
		<view class="" v-else>
			<u-gap height="10" bg-color="#e3e3e3"></u-gap>
		</view>
	</view>
</template>
<script>
	import {
		getBackUrl
	} from '../../../util/api'
	export default {
		name: "",

		props: {
			showBline: {
				type: Boolean,
				default: false
			},
			showLine: {
				type: Boolean,
				default: true
			},
			lineShow: {
				type: Boolean,
				default: true
			},
			btnString: String,
			showDataImg: {
				type: Boolean,
				default: true
			},
			url: String,
			disabled: {
				type: Boolean,
				default () {
					return false
				}
			}
		},

		methods: {
			jump() {
				if (this.disabled) {
					return
				}
				if (this.url) {
					this.$u.route({
						url: this.url.includes('wx_login') ? this.url + `?backUrl=${ getBackUrl() }` : this.url,
						type: this.url.includes('wx_login') ? 'reLaunch' : 'navigateTo'
					})
				}
			}
		}
	}
</script>

<style scoped lang="scss">
	.u-flex-col {
		width: 100%;
		margin: 0 auto;
	}

	.img {
		width: 146px;
		height: 146px;
	}

	.btn {
		padding: 20rpx 0rpx;
		background: #2A6CAC;
		color: #fff;
		border-radius: 23px;
		width: 640rpx;
		text-align: center;
	}

	.disabled {
		background: rgba(200, 200, 200, 100);
	}
</style>
